package com.wdemo.enums;

/**
 * @ClassName ChatTypeEnum
 * @Description 会话类型枚举类
 * @Author WDEMO
 * @Date 2025/8/20 20:14
 */
public enum EmbeddingTypeEnum {

    CHAT("EMBEDDING:CHAT","会话向量库类型","CHAT_INDEX"),
    SERVICE("EMBEDDING:SERVICE","会话向量库类型","SERVICE_INDEX"),
    PDF("EMBEDDING:PDF","会话向量库类型","PDF_INDEX");

    private final String type;

    private final String name;

    private final String index;

    EmbeddingTypeEnum(String type, String name ,String index) {
        this.type = type;
        this.name = name;
        this.index=index;
    }

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public String getIndex() {
        return index;
    }

    public static EmbeddingTypeEnum fromString(String type) {
        for (EmbeddingTypeEnum chatType : EmbeddingTypeEnum.values()) {
//            判断当前枚举常量的名称是否与传入的字符串 type 忽略大小写相等。
            if (chatType.name().equalsIgnoreCase(type)) {
                return chatType;
            }
        }
        throw new IllegalArgumentException("Unsupported chat type: " + type);
    }
}
